import { get, post } from "@/utils/request";

/**
 * 获取日历待办数量
 * @param {*} params
 * @returns
 */
export const fetchTodoCount = (params) => {
  return post("/todo/count-by-date", params);
};

/**
 * 获取待办列表
 * @param {*} params
 * @returns
 */
export const fetchTodoList = (params) => {
  let pageNum = params.pageNum;
  delete params.pageNum;
  return post(
    `/notice/list-notice-and-todo-by-date?pageNum=${pageNum}`,
    params
  );
};
/**
 * 新增待办
 * @param {*} params
 * @returns
 */
export const fetchTodoCreate = (params) => {
  return post("/todo/create", params);
};

/**
 * 外出申请
 * @param {*} params
 * @returns
 */
export const fetchTodoApply = (params) => {
  return post("/todo/apply", params);
};

/**
 * 签到/签出
 * @param {*} params
 * @returns
 */
export const fetchTodoSign = (params) => {
  return post("/todo/sign", params);
};

/**
 * 取消外出
 * @param {*} params
 * @returns
 */
export const fetchTodoCancel = (params) => {
  return post("/todo/cancel", params);
};

/**
 * 接收/拒绝店铺转移
 * @param {*} params
 * @returns
 */
export const fetchStoreProcess = (params) => {
  return get("/store/move/process", params);
};

/**
 * 跟进
 * @param {*} params
 * @returns
 */
export const fetchTodoFollow = (params) => {
  return post("/follow/up/add/follow", params);
};

/**
 * 事项详情
 * @param {*} params
 * @returns
 */
export const fetchTodoDetail = (params) => {
  return get("/go/out/detail", params);
};

/**
 * 查询代办执行人
 * @param {*} params
 * @returns
 */
export const fetchTodoUser = (params) => {
  return get("/todo/executorList", params);
};

/**
 * 查询代办商机
 * @param {*} params
 * @returns
 */
export const fetchTodoBusiness = (params) => {
  return post("/business/search", params);
};

/**
 * 新增商机
 * @param {*} params
 * @returns
 */
export const fetchBusinessOpportunity = (params) => {
  return post("/business/opportunity/add", params);
};
